<?php

namespace App\Http\Transformers;

use App\Models\Goods;
use League\Fractal\TransformerAbstract;

class GoodsTransformer extends TransformerAbstract {

    public function transform(Goods $item) {
        return [
            'id' => $item->id,
            'name' => $item->name,
            'desc' => $item->desc,
            'img_urls' => $item->img_urls,
            'price' => $item->price,
            'attribute' => $item->attribute,
            'detail' => $item->detail,
            'category_id' => $item->category_id,
            'created_at' => (string) $item->created_at,
            'updated_at' => (string) $item->updated_at,
        ];
    }

}
